<%@ page language="java" pageEncoding="ISO-8859-1" import="java.util.*"%>

<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-template" prefix="template" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-nested" prefix="nested" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html locale="true">
  <head>
    <html:base />
    
    <title>comperipheral.jsp</title>

	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<script type="text/javascript">

function checkblank(f)
{
  var fps=f.ps.value
   var fpo=f.po.value
   fed=f.ed.value
   
   if((fps.match("select")) || (fpo.match("select")) || (fpo.length==0))
   {
      alert("pls fill all d fields")
      if(fpc.match("select"))
      {
         document.getElementById("pps").innerHTML="<font color=red>This field shdnt be left blank</font>"
      }
      if(fpon.match("select"))
      {
         document.getElementById("ppo").innerHTML="<font color=red>This field shdnt be left blank</font>"
      }
      if(fpon.length==0)
      {
         document.getElementById("ped").innerHTML="<font color=red>This field shdnt be left blank</font>"
      }
      return false;
  }
}
</script>
<script language="javascript" type="text/javascript" src="datetimepicker_css.js"></script>
  <link href="css/style1.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="pink">
<div class="main-out">
<div class="main">
<div class="page">
<div class="top">
<div class="header">
<div class="header-top">
<%@include file="TopHead.jsp" %>
</div>
<div class="topmenu">
<%@include file="TopMenu.jsp" %>
</div>
<div class="">
<img src="images/d3.gif">
</div>
</div>
<div class="content">
<div class="content-left">
<div class="row1">
<div class="img">&nbsp;</div>
<div class="welcome">
<h1 class="title">Welcome to POlice Sewa<span></span></h1>
<p>




</p>


<%
  
  ArrayList psid=(ArrayList)request.getAttribute("UD");
   ArrayList psn=(ArrayList)request.getAttribute("PS");
   ArrayList pc=(ArrayList)request.getAttribute("PO");
   ArrayList pon=(ArrayList)request.getAttribute("PONM");
  
   %> 
 
    
  <html:form action="comperia" onsubmit="return checkblank(this)"> 
    <div align="center">
	<table border="0" width="100%">
	
	<%
	Object ob1=request.getAttribute("jlt");
	if(ob1!=null){
	 %>
	 
		<tr>
			<td colspan="3"><font color="#6600CC"><u>Police Station Peripheral</u> </font></td>
		</tr>
	
		<tr>
			<td>Police station</td>
			<td><html:select property="ps">
			<html:option value="select">Enter police station name</html:option>
			
			<% 
			 if(psid !=null)
					         {
					         
							 for(int i=0;i<psn.size();i++)
		    	             {
		    	             System.out.print(psid.get(i).toString());
		    	             %>
							
							
							<html:option value="<%=psid.get(i).toString()%>"> <%=psn.get(i).toString()%></html:option>
							
							<%
							} }
							%>
			
			
			
			</html:select> </td>
			<td><label id="pps"></label></td>
		</tr>
		
		<tr>
			<td>post office</td>
			<td><html:select property="po">
			<html:option value="select">Enter post office name</html:option>
			<% 
			 if(pc !=null)
					         {
					         
							 for(int i=0;i<pon.size();i++)
		    	             {
		    	             System.out.print(pc.get(i).toString());
		    	             %>
							
							
							<html:option value="<%=pc.get(i).toString()%>"> <%=pon.get(i).toString()%></html:option>
							
							<%
							} }
							%>
			
			
			
			</html:select> </td>
			<td><label id="ppo"></label></td>
		</tr>
		<tr>
			<td>Effect date</td>
			<td width="76%">
<input type="text" name="T2" id="demo3" size="20" readonly="readonly" onfocus="javascript:NewCssCal('demo3','ddMMMyyyy','arrow')" value="">
</td>


			<td><label id="ped"></label></td>
		</tr>
		<tr>
			<td colspan="3"><html:submit value="PoliceStationPeripheral" property="comperip"></html:submit> </td>
		</tr>
		
		<tr>
			<td colspan="3"><a href="<%=request.getContextPath()%>/comperia.do?comperip=ViewCommPeriperal">VIEW/EDIT</a> </td>
		</tr>
		
		
		<tr>
			<td colspan="3"><%=ob1.toString() %> </td>
		</tr>
		<%}
		else
		{ %>
	
	<tr>
			<td colspan="3"><font color="#6600CC"><u>Police Station Peripheral</u> </font></td>
		</tr>
	
		<tr>
			<td>Police station</td>
			<td><html:select property="ps">
			<html:option value="select">Enter police station name</html:option>
			
			<% 
			 if(psid !=null)
					         {
					         
							 for(int i=0;i<psn.size();i++)
		    	             {
		    	             System.out.print(psid.get(i).toString());
		    	             %>
							
							
							<html:option value="<%=psid.get(i).toString()%>"> <%=psn.get(i).toString()%></html:option>
							
							<%
							} }
							%>
			
			
			
			</html:select> </td>
			<td><label id="pps"></label></td>
		</tr>
		
		<tr>
			<td>post office</td>
			<td><html:select property="po">
			<html:option value="select">Enter post office name</html:option>
			<% 
			 if(pc !=null)
					         {
					         
							 for(int i=0;i<pon.size();i++)
		    	             {
		    	             System.out.print(pc.get(i).toString());
		    	             %>
							
							
							<html:option value="<%=pc.get(i).toString()%>"> <%=pon.get(i).toString()%></html:option>
							
							<%
							} }
							%>
			
			
			
			</html:select> </td>
			<td><label id="ppo"></label></td>
		</tr>
		<tr>
			<td>Effect date</td>
			<td width="76%">
<input type="text" name="T2" id="demo3" size="20" readonly="readonly" onfocus="javascript:NewCssCal('demo3','ddMMMyyyy','arrow')">
</td>


			<td><label id="ped"></label></td>
		</tr>
		<tr>
			<td colspan="3"><html:submit value="PoliceStationPeripheral" property="comperip"></html:submit> </td>
		</tr>
		
		<tr>
			<td colspan="3"><a href="<%=request.getContextPath()%>/comperia.do?comperip=ViewCommPeriperal">VIEW/EDIT</a> </td>
		</tr>
		
	
	<%} %>
		
	</table>
</div>
</html:form> 
    
</div>
</div>

</div>
<div class="content-right">
<%@include file="SideMenu.jsp" %>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
</div>
</div>
<div class="bottom">
<!--DO NOT Remove The Footer Links-->
<p><%@include file="Footer.jsp"  %><br>
<!--DO NOT Remove The Footer Links-->
</p>
</div>
</div>
</div>
</div>
</body>
</html:html>
